<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" th:href="@{/css/pintuer.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body>
<form id="form" class="layui-form-pane">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">标题：</label>
        <div class="layui-input-block">
            <input class="layui-input" id="rname" name="rname"  autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-block">
            <select id="status" name="status" class="layui-select" style="width: 185px;padding: 0px;padding-left: 10px" lay-verify="required" lay-search="">
                <option value="正常" >正常</option>
                <option value="注销" >注销</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">描述：</label>
        <div class="layui-input-block">
            <input class="layui-input" id="person" name="person"  autocomplete="off"/>
        </div>
    </div>
    <br/>
    <div class="layui-form-item layui-inline" style="float: right; margin-right: 10px;">
        <button class="layui-btn" id="addMenu">提交</button>
        <button class="layui-btn layui-btn-danger" onclick="closePage()">关闭</button>
    </div>
</form>
</body>
<script th:src="@{/js/jquery-2.1.0.js}"></script>
<script th:src="@{/js/pintuer.js}"></script>
<script th:src="@{/layui/layui.js}"></script>
<script th:inline="javascript">
    var index = parent.layer.getFrameIndex(window.name);
    layui.use('form','layer',function(){
        var form = layui.form;
        form.render();
    });
    layui.use('layer',function(){
        var layer=layui.layer;
    });

    function closePage() {
        parent.layer.close(index);//关闭当前页
    }

    $('#addMenu').click(function(){
        alert("tianjia");
        $.ajax({
            type:'post',
            url:'/role/saveRole',
            data:$("#form").serialize(),
            dataType: "text",
            async: false,
            success:function (data) {
                if (data === 1){
                }
            }
        });
        window.parent.location.reload();//刷新父页面
        parent.layer.close(index);
    });
</script>
</html>